package com.amigo.online.provider;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.filters.discovery.PatternServiceRouteMapper;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.amigo.online.provider.sync.cloud.zuul.AccessFilter;

/**
 * @version: V 1.0.0
 * @Description: （数据异步处理服务）
 * @author: zxy QQ:1363320658
 * @date: 2018年12月10日 下午3:00:06
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableTransactionManagement
@EnableScheduling
@EnableKafka
public class AmigoOnlineProviderDataApplication {
    public static void main(String[] args) {
        SpringApplication.run(AmigoOnlineProviderDataApplication.class, args);
    }

    @Bean
    public AccessFilter accessFilter() {
        return new AccessFilter();
    }

    @Bean
    public PatternServiceRouteMapper serviceRouteMapper() {
        // 第一个参数匹配服务名称是否符合自定义路劲表达式
        // 第二个参数路径转换表达式
        return null;// new
        // PatternServiceRouteMapper("(?<name>?.+)-(?<version>v.+$?)","${version}/${name}");
    }
}
